<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <script src="http://cdn.bootcss.com/js-bson/0.5.2/bson.js"></script>
    <title></title>
</head>

<body>

</body>
<script type="text/javascript">
    var BSON = bson().BSON
    var Long = bson().Long
    var doc = {
        title: "MongoDB",
        last_editor: "192.168.1.122",
        last_modified: new Date("27/06/2011"),
        body: "MongoDB introduction",
        categories: ["Database", "NoSQL", "BSON"],
        revieved: false,
        a:{
            b:{
                c:1
            }
        }
    }
    var data = BSON.serialize(doc, true, true)
    console.log(data);
    var doc2 = BSON.deserialize(data)
    console.log(doc2);
</script>

</html>
